package listbyorder.access201_300.test268;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/6/27 12:19
 */
public class Solution1 {

    public int missingNumber(int[] nums) {
        int len = nums.length;
        int sum = ((1 + len) * len) / 2;
        for (int i = 0; i < nums.length; i++) {
            sum -= nums[i];
        }
        return sum;
    }
}
